//
//  CourseCollectionViewCell0.m
//  Civacrm
//
//  Created by 王桂敏 on 2017/2/23.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "CourseCollectionViewCell0.h"

@implementation CourseCollectionViewCell0

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView{
    self.backgroundColor = WhiteColor;
    
    self.imageView = [UIImageView imageViewWithFrame:CGRectMake(0, 0, (kScreenWidth - w(60)) / 2, h(136)) image:nil];
    self.imageView.centerX = (kScreenWidth - w(60)) / 4;
    [self addSubview:self.imageView];
    
    self.titleLabel = [UILabel labelWithTitle:nil frame:CGRectMake(self.imageView.x, getMaxY(self.imageView), self.imageView.width, h(74)) font:font(20) textColor:ColorWithHexString(@"4e778f") bgColor:ClearColor];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    self.titleLabel.numberOfLines = 0;
    [self addSubview:self.titleLabel];
    
}

- (void)configCellWithModel:(CourseModel *)model
                        col:(NSInteger)col{
    self.imageView.width = (kScreenWidth - w(60)) / col;
    self.imageView.centerX = (kScreenWidth - w(60)) / (col * 2);

    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.taskModel.cl5] placeholderImage:Image(@"daititupian2")];
    self.titleLabel.text = model.taskModel.taskName;
    
}

@end
